//index.js
//获取应用实例
import { request } from "../../request/index"
Page({

  /**
   * 页面的初始数据
   */
  data: {
    swiperList:[], // 轮播图数组
    catesList:[], // 导航数组
    floorList:[], // 楼层数据
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
     this.getSwiperList()
     this.getCatesList()
     this.getFloorList()
  },

  getSwiperList(){
    request({url: '/home/swiperdata'}).then((result)=>{
      this.setData({swiperList:result})

    })
  },
  getCatesList(){
    request({url: '/home/catitems'}).then((result)=>{
      this.setData({catesList:result})

    })
  },
  getFloorList(){
    request({url: '/home/floordata'}).then((result)=>{
      this.setData({floorList:result})

    })
  }
})
